package com.web.music;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.web.music.common.BeanRegistry;
import com.web.music.impl.DomXmlParser;
import com.web.music.interfaces.MusicProcessor;

/**
 * Entry point into application.
 */
public class MusicMain {
	static Logger logger = Logger.getLogger(DomXmlParser.class.getName());

	public static void main(String[] args) 
	{
		logger.info("[MusicMain] Application started");
		// initialize Spring application context from configuration file
		ApplicationContext appCtxt = new ClassPathXmlApplicationContext(BeanRegistry.BEAN_CONFIG_FILE);
		MusicProcessor musicProcessor = (MusicProcessor)appCtxt.getBean(BeanRegistry.MUSIC_PROCESSOR);
		musicProcessor.execute();	
		logger.info("[MusicMain] Application execution successfully completed");
	}

}
